/**
 *
 *
 * 
 *
 * 
 */

package io.dbw.common.exception;

import io.dbw.common.enums.ResultStatusEnum;

/**
　* @description: 自定义异常
　* @author lxc
　* @date 2021/4/29 13:49
*/
public class BusinessException extends RuntimeException {
	private static final long serialVersionUID = 1L;
	
    private String msg;
    private String code = "101";
    
    public BusinessException(String msg) {
		super(msg);
		this.msg = msg;
	}
    public BusinessException(ResultStatusEnum r) {
    	this.code=r.getCode();
    	this.msg=r.getMsg();
	}

	public BusinessException(String msg, Throwable e) {
		super(msg, e);
		this.msg = msg;
	}
	
	public BusinessException(String code,String msg ) {
		super(msg);
		this.msg = msg;
		this.code = code;
	}
	
	public BusinessException(String code,String msg,  Throwable e) {
		super(msg, e);
		this.msg = msg;
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	
}
